/**
 * Description:一些注释<br/>
 * CreateTime:2019-04-02<br/>
 * Creater: yangpengfei360@126.com <br/>
 * @author yangpengfei
 */
package cn.cnsy123.bookwebsiteserver.vo.ztree;
/**
 * Description:一些注释<br/>
 * CreateTime:2019-04-02<br/>
 * Creater: yangpengfei360@126.com <br/>
 * @author yangpengfei
 */
public class TreeResult {
    
    private String name;
    
    private Integer id;
    
    private Integer pId;
    
    private Boolean checked;
    
    private Boolean open = (pId == null ? true :false);
    
    private Boolean chkDisabled = false;

    private Boolean nocheck;
    
    
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getpId() {
        return pId;
    }

    public void setpId(Integer pId) {
        this.pId = pId;
    }

    public Boolean getChecked() {
        return checked;
    }

    public void setChecked(Boolean checked) {
        this.checked = checked;
    }

    public Boolean getOpen() {
        return open;
    }

    public void setOpen(Boolean open) {
        this.open = open;
    }

    public Boolean getChkDisabled() {
        return chkDisabled;
    }

    public void setChkDisabled(Boolean chkDisabled) {
        this.chkDisabled = chkDisabled;
    }
    
    

    public Boolean getNocheck() {
        return nocheck;
    }

    public void setNocheck(Boolean nocheck) {
        this.nocheck = nocheck;
    }

    public TreeResult() {
        
    }

    public TreeResult(String name, Integer id, Integer pId, Boolean checked, Boolean open, Boolean chkDisabled,
            Boolean nocheck) {
        this.name = name;
        this.id = id;
        this.pId = pId;
        this.checked = checked;
        this.open = open;
        this.chkDisabled = chkDisabled;
        this.nocheck = nocheck;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("{\"name\":");
        builder.append(name);
        builder.append(", \"id\":");
        builder.append(id);
        builder.append(", \"pId\":");
        builder.append(pId);
        builder.append(", \"checked\":");
        builder.append(checked);
        builder.append(", \"open\":");
        builder.append(open);
        builder.append(", \"chkDisabled\":");
        builder.append(chkDisabled);
        builder.append(", \"nocheck\":");
        builder.append(nocheck);
        builder.append("}");
        return builder.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((checked == null) ? 0 : checked.hashCode());
        result = prime * result + ((chkDisabled == null) ? 0 : chkDisabled.hashCode());
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        result = prime * result + ((name == null) ? 0 : name.hashCode());
        result = prime * result + ((nocheck == null) ? 0 : nocheck.hashCode());
        result = prime * result + ((open == null) ? 0 : open.hashCode());
        result = prime * result + ((pId == null) ? 0 : pId.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        TreeResult other = (TreeResult) obj;
        if (checked == null) {
            if (other.checked != null)
                return false;
        } else if (!checked.equals(other.checked))
            return false;
        if (chkDisabled == null) {
            if (other.chkDisabled != null)
                return false;
        } else if (!chkDisabled.equals(other.chkDisabled))
            return false;
        if (id == null) {
            if (other.id != null)
                return false;
        } else if (!id.equals(other.id))
            return false;
        if (name == null) {
            if (other.name != null)
                return false;
        } else if (!name.equals(other.name))
            return false;
        if (nocheck == null) {
            if (other.nocheck != null)
                return false;
        } else if (!nocheck.equals(other.nocheck))
            return false;
        if (open == null) {
            if (other.open != null)
                return false;
        } else if (!open.equals(other.open))
            return false;
        if (pId == null) {
            if (other.pId != null)
                return false;
        } else if (!pId.equals(other.pId))
            return false;
        return true;
    }

    
    
    
    
    
    

}
